package com.xinggq.user.service.dto.tenant;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

import java.time.LocalDateTime;

/**
 * 租户更新请求DTO
 *
 * @author xinggq
 * @since 2025-01-01
 */
@Schema(description = "租户更新请求")
public record TenantUpdateRequest(
    
    @Schema(description = "租户ID", example = "1")
    @NotNull(message = "租户ID不能为空")
    Long id,
    
    @Schema(description = "租户名称", example = "测试租户")
    @Size(max = 100, message = "租户名称长度不能超过100个字符")
    String tenantName,
    
    @Schema(description = "租户域名", example = "tenant.example.com")
    @Size(max = 100, message = "租户域名长度不能超过100个字符")
    String domain,
    
    @Schema(description = "联系人", example = "张三")
    @Size(max = 50, message = "联系人长度不能超过50个字符")
    String contactPerson,
    
    @Schema(description = "联系电话", example = "13800138000")
    @Size(max = 20, message = "联系电话长度不能超过20个字符")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确")
    String contactPhone,
    
    @Schema(description = "联系邮箱", example = "contact@example.com")
    @Size(max = 100, message = "联系邮箱长度不能超过100个字符")
    String contactEmail,
    
    @Schema(description = "租户地址", example = "北京市朝阳区")
    @Size(max = 200, message = "租户地址长度不能超过200个字符")
    String address,
    
    @Schema(description = "租户描述", example = "这是一个测试租户")
    @Size(max = 500, message = "租户描述长度不能超过500个字符")
    String description,
    
    @Schema(description = "到期时间", example = "2025-12-31 23:59:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    LocalDateTime expireTime,
    
    @Schema(description = "最大用户数", example = "100")
    Integer maxUsers
) {
}